﻿using System;
using System.Threading;
using System.Threading.Tasks;

namespace Proxy
{

    public class MachineHandle
    {
        SearchInfoHandle Handle_Search;
        ModifyInfoHandle Handle_Modify;
        public MachineHandle()
        {
            Handle_Search = new SearchInfoHandle();
            Handle_Modify = new ModifyInfoHandle();

            Task.Factory.StartNew(() => Position_Transport("101"));
            Task.Factory.StartNew(() => Position_Transport("102"));
            Task.Factory.StartNew(() => Position_Transport("201"));
            Task.Factory.StartNew(() => Position_Transport("202"));
        }


        public void Position_Transport(string Location)
        {
            var log = SerilogHandle.Logger_P35;
            do
            {
            Start:
                Thread.Sleep(1000);
                try
                {
                    if (Globle.isInfeedActive)
                    {
                        goto Start;
                    }
                }
                catch (Exception ex)
                {
                    log.Error(ex.Message);
                }
            } while (true);
        }
    }
}

